<?php

namespace app\app\validate\order;

use think\Validate;

class GoodsOrderValidate extends Validate
{
    protected $rule = [
        'order_no' => 'require',
        'goods' => 'require|array',
        'type' => 'require|in:100,200,300',
        'board_number' => 'require',
        'shop_id' => 'require',
        'cash_amount' => 'require|>:0',
    ];

    protected $message = [
        'order_no' => 'Order number cannot be empty',
        'goods' => 'Product information cannot be empty',
        'type' => 'Please select a valid type',
        'pay_method' => 'Please select a valid payment method',
        'board_number' => 'Please select a valid board number'
    ];

    protected $scene = [
        'create' => ['goods', 'type'],
        'edit' => ['order_no', 'goods'],
        'info' => ['order_no'],
        'cashPayOrder' => ['order_no','cash_amount'],
        'tntPayOrder' => ['order_no'],
        'cancelOrder' => ['order_no'],
        'clearTable' => ['board_number'],
        'boardInfo' => ['board_number'],
        'updateOrder' => ['order_no', 'goods'],
        'goodsListInfo' => ['goods'],
    ];
}